package com.edu.cloud.center.web;

import com.edu.cloud.center.api.IEchoApi;
import com.edu.cloud.center.api.User;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class EchoController implements IEchoApi {
    @Override
    public String echo(String str) {
        return "center:"+str;
    }

    @Override
    public String echo1s(String str) throws InterruptedException {
        Thread.sleep(1000);
        return "get1s:"+str;
    }

    @Override
    public String echo2s(String str) throws InterruptedException {
        Thread.sleep(2000);
        return "get2s:"+str;
    }

    @Override
    public String echo3s(String str) throws InterruptedException {
        Thread.sleep(3000);
        return "get3s:"+str;
    }

    @Override
    public String echo2(String str1, String str2) {
        return "get:"+str1+":"+str2;
    }

    @Override
    public String echoPost(String str1, String str2) {
        return "post:"+str1+":"+str2;
    }

    @Override
    public String echoPostPojo(User u) {
        return "postpojo:"+u.getName()+":"+u.getAge();
    }
}
